import request from '@/utils/request'
/**
 * 部门列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function fetchTreeList() {
  return request({
    url: '/scrm-api/console/work/contact/department/tree',
    method: 'get'
  })
}

/**
 * 部门搜索
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function searchTreeList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/department/search',
    method: 'get',
    params: data
  })
}

/**
 * 新增部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function addTreeList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/department/add',
    method: 'post',
    data: data
  })
}
/**
 * 删除部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function delTreeList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/department/del',
    method: 'post',
    data: data
  })
}
/**
 * 员工列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workUserList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/work-user/list',
    method: 'get',
    params: data
  })
}
/**
 * 添加员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function addUserList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/work-user/add',
    method: 'post',
    data: data
  })
}
/**
 * 获取标签组列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagList() {
  return request({
    url: '/scrm-api/console/work/contact/user-tag/group-list',
    method: 'get'
  })
}
/**
 * 获取标签列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagsList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/user-tag/user-tag-list',
    method: 'get',
    params: data
  })
}
/**
 * 新增标签
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagsAdd(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/user-tag/user-tag-add',
    method: 'post',
    data: data
  })
}
/**
 * 删除员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function delWorkUser(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/work-user/del',
    method: 'post',
    data: data
  })
}
/**
 * 通讯录同步
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workContact() {
  return request({
    url: '/scrm-api/console/work/contact/sync',
    method: 'post'
  })
}
/**
 * 更新部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function updateDepartment(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/department/update',
    method: 'post',
    data: data
  })
}
/**
 * 获取员工详情
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workUserDetail(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/work-user/detail',
    method: 'get',
    params: data
  })
}
/**
 * 添加员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function putUserList(data: any) {
  return request({
    url: '/scrm-api/console/work/contact/work-user/put',
    method: 'post',
    data: data
  })
}
